package com.tbynet.jwp.repository.spi;

import com.tbynet.jwp.framework.core._JwpService;
import com.tbynet.jwp.model.Posts;

import java.util.Date;
import java.util.List;

/**
 * 文章备份服务接口
 * @ClassName: PostBackupService
 * @Description: 负责文章数据的备份和恢复功能
 * @Author: 佰亿互联
 * @Date: 2025年11月4日
 *
 * @Copyright: 2025 www.tbynet.com Inc. All rights reserved.
 * 注意: 本内容仅限于内部传阅，禁止外泄以及用于其他的商业目
 */
public interface PostBackupService extends _JwpService<Posts> {

    /**
     * 创建文章备份
     */
    String createBackup(String backupType);

    /**
     * 恢复文章备份
     */
    boolean restoreBackup(String backupFile);

    /**
     * 获取备份列表
     */
    List<BackupInfo> getBackupList();

    /**
     * 删除备份文件
     */
    boolean deleteBackup(String backupFile);

    /**
     * 自动备份
     */
    void autoBackup();

    /**
     * 导出备份到远程存储
     */
    boolean exportBackup(String backupFile, String remoteType);

    /**
     * 从远程存储导入备份
     */
    boolean importBackup(String remoteFile, String remoteType);

    /**
     * 备份信息类
     */
    class BackupInfo {
        private String fileName;
        private Date createTime;
        private long fileSize;
        private String backupType;

        // getters and setters
        public String getFileName() { return fileName; }
        public void setFileName(String fileName) { this.fileName = fileName; }

        public Date getCreateTime() { return createTime; }
        public void setCreateTime(Date createTime) { this.createTime = createTime; }

        public long getFileSize() { return fileSize; }
        public void setFileSize(long fileSize) { this.fileSize = fileSize; }

        public String getBackupType() { return backupType; }
        public void setBackupType(String backupType) { this.backupType = backupType; }
    }
}
